/**
 * 
 */
package hihocoder;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Scanner;

/**
 * @author zhongfang
 *
 */
public class 紧张的会议室 {

	static class Room implements Comparable<Room> {
		int minSpaceTime;
		int startTime = -1;

		@Override
		public int compareTo(Room o) {
			return minSpaceTime - o.minSpaceTime;
		}

	}

	static class Comp implements Comparator<int[]> {
		@Override
		public int compare(int[] o1, int[] o2) {// 起始时间小，终止时间大的放前面
			if (o1[0] == o2[0]) {
				return o2[1] - o1[1];
			}
			return o1[0] - o2[0];
		}
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int M = scanner.nextInt();
		int[][] qujian = new int[N][2];
		for (int i = 0; i < N; i++) {
			qujian[i][0] = scanner.nextInt();
			qujian[i][1] = scanner.nextInt();
		}
		Comp comp = new Comp();
		Arrays.sort(qujian, comp);

		PriorityQueue<Room> spaceMinTime = new PriorityQueue<>();
		for (int i = 0; i < M; i++) {
			spaceMinTime.add(new Room());
		}

		int[][] spaceTime = new int[N][2];
		int j = 0;
		while (j < N) {
			Room curRoom = spaceMinTime.poll();
			int startTime = curRoom.minSpaceTime;
			spaceTime[j] = (new int[] { startTime, qujian[j][0] });// 空闲区间
			curRoom.minSpaceTime = qujian[j][1];
			spaceMinTime.add(curRoom);
			j++;
		}

		// 优先队列转list
		ArrayList<Room> endlist = new ArrayList<>(spaceMinTime.size());
		while (!spaceMinTime.isEmpty()) {
			endlist.add(spaceMinTime.poll());
		}
		spaceMinTime = null;
		Arrays.sort(spaceTime, comp);// 空闲会议室排序
		int Q = scanner.nextInt();
		for (int i = 0; i < Q; i++) {
			int x = scanner.nextInt();
			int y = scanner.nextInt();
			if (afterAny(endlist, x)) {
				System.out.println("YES");
				continue;
			}
			if (findLarge(spaceTime, x, y, comp)) {
				System.out.println("YES");
			} else {
				System.out.println("No");
			}
		}
	}

	private static boolean findLarge(int[][] spaceTime, int x, int y, Comp compareSpace) {
		// int[] target = new int[] { x, y };
		// int n = spaceTime.length;
		// int index = Arrays.binarySearch(spaceTime, target, compareSpace);
		// if (index < 0) {
		// index = -index - 1;// 第一个比target大的位置
		// }
		// if (index == n && !(x >= spaceTime[n - 1][0] && y >= spaceTime[n -
		// 1][1])) {// 没有比他更小的
		// return false;
		// }
		// // 有可能长度一样，就需要起始时间<=x，结束时间>=y
		//
		// // 左侧有没有可能时间和他一样长，但是起始时间小——可能，所以要修改com函数
		// // 有时间长度上比他长的
		// // 还要求起始时间比他小
		// if (spaceTime[index][0] <= x) {
		// return true;
		// }

		int left = 0, right = spaceTime.length - 1;
		while (left < right) {
			int mid = (left + right) >> 1;
			if (spaceTime[mid][0] > x) {// 起始不满足
				left = mid + 1;
			} else if (spaceTime[mid][0] <= x) {
				if (spaceTime[mid][1] >= y) {
					return true;
				} else {// 终止时间不满足
					right = mid - 1;
				}
			}
		}
		return false;
	}

	private static boolean afterAny(ArrayList<Room> spaceMinTime, int x) {
		for (Room room : spaceMinTime) {
			if (x >= room.minSpaceTime) {
				return true;
			}
		}
		return false;
	}
}
